UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JSF/TtYxq2jGPXzl3cHsaQmVSZExOREsQKQtaKT5HfA=' 
WHERE 
  key_id = '22b44a4f907fc587f9a2992539614f0e53518b2caf04af2fb5463f1ad47b794d' 
  AND (
    token = 'JSF/TtYxq2jGPXzl3cHsaQmVSZExOREsQKQtaKT5HfA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027