UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '26AHE6h1/rOueEFGMMfh9ZnkGEcsbUOQBmeuWIqaOpE=' 
WHERE 
  key_id = 'bedbc205b41cf025b2105b1b17961483fb0d95e13efb4660d52f9324f395214e' 
  AND (
    token = '26AHE6h1/rOueEFGMMfh9ZnkGEcsbUOQBmeuWIqaOpE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026