UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jr/ifs5KpQgLDoCVMEOnb23ImIWERn1UU2besfz/75A=' 
WHERE 
  key_id = 'dbc659d70fe3ea871aeee1fc806c11f99909a6ab29e604b5c75984e4ad0cee40' 
  AND (
    token = 'Jr/ifs5KpQgLDoCVMEOnb23ImIWERn1UU2besfz/75A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045