UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rMScuTl3+a1jRgbIEYwJzoL5moMK3cVeWp7SG+PovSs=' 
WHERE 
  key_id = '7f50db8d9ead1d92e77ddd2daaf4cf3912d6b1c26449cd1d2b052f613bea4493' 
  AND (
    token = 'rMScuTl3+a1jRgbIEYwJzoL5moMK3cVeWp7SG+PovSs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056