UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qGO4dKgq+H7dRCUnLqT16+bbNnYBE727xcCMYCwar6c=' 
WHERE 
  key_id = 'a135f9bc470b1e411dbf1d590816d3f5a95b24529194947b676b920b35a0b4d3' 
  AND (
    token = 'qGO4dKgq+H7dRCUnLqT16+bbNnYBE727xcCMYCwar6c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019