UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MKGFtNku/FPMjaKHBSfsQJrUIfSuJZP+ui8BRwiyeyE=' 
WHERE 
  key_id = '946ff44225bcc5475528de727847fc7a68dc71810f84fb338e86c17c4d0fd267' 
  AND (
    token = 'MKGFtNku/FPMjaKHBSfsQJrUIfSuJZP+ui8BRwiyeyE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018