UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EGfsL6/GnZJ9+qp0Gn5/82ZRT2XtHivVeRtceyNujno=' 
WHERE 
  key_id = '219c74a65efe5509cfba003a78f174e805da96a27cfdc21a35e4cd4d2c474c8f' 
  AND (
    token = 'EGfsL6/GnZJ9+qp0Gn5/82ZRT2XtHivVeRtceyNujno=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030