UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ygT6OKaPz/+Vh5z/TdZCi5ppZZLq3rPTHkV69a+WAko=' 
WHERE 
  key_id = 'c6b15a7c5d7fb53976ba04eb9b8b2f6c38d641918a93eafcc9412350b3d6e3ce' 
  AND (
    token = 'ygT6OKaPz/+Vh5z/TdZCi5ppZZLq3rPTHkV69a+WAko=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019