UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7KR22j+AsZAq5bzNb5Kk/YIOHti7m1DJTGXP5mp35qM=' 
WHERE 
  key_id = 'f00259116903ebe00e48daef1f0da369a666c462023fc1e4199872d9b148b73b' 
  AND (
    token = '7KR22j+AsZAq5bzNb5Kk/YIOHti7m1DJTGXP5mp35qM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030