UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rRRml9k3T8wgu0Cqnvpwgy9JofiaUTPptzUNb+gDDeE=' 
WHERE 
  key_id = '44abe5005dd5a9924a3042c6a32792fa3f9897daec40f65c105b85a3dde77fa7' 
  AND (
    token = 'rRRml9k3T8wgu0Cqnvpwgy9JofiaUTPptzUNb+gDDeE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038