UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xL9fxTK7AL86kkW0+X2KnF+3oTgNww0/UePKFOKKvX0=' 
WHERE 
  key_id = '0c36035fe8b987b50c4c4d16bd4e726eb6d8acd02682e1dd01e656e26642900c' 
  AND (
    token = 'xL9fxTK7AL86kkW0+X2KnF+3oTgNww0/UePKFOKKvX0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047