UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J8Oi+MMghHv104X+ftNc4g8EVaOQLQmPk+iXmm30H3g=' 
WHERE 
  key_id = '14af7819d1d1252b60916c1cf43d281fd2fc2550afe8eb57efa46f60cce5f828' 
  AND (
    token = 'J8Oi+MMghHv104X+ftNc4g8EVaOQLQmPk+iXmm30H3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031