UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'soiTCtB6ganJPOPf2M7LfV+ZFZDbyV7e6BKYHZpV9AQ=' 
WHERE 
  key_id = '10eeb8a5ad5b019d9382953b4f8156594573b735302e933db4edef548e3307aa' 
  AND (
    token = 'soiTCtB6ganJPOPf2M7LfV+ZFZDbyV7e6BKYHZpV9AQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026