UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JR3lBC8REK87JftquwpdaeXlbb+NEKYmW6cV/JQoMBw=' 
WHERE 
  key_id = '53b50cfce4d9f69eb5dc148582ec4d7328bb4a602147343bb98ff7482a6bb85b' 
  AND (
    token = 'JR3lBC8REK87JftquwpdaeXlbb+NEKYmW6cV/JQoMBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018