UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cgEQP98kFKIefkrb+nRomF4r2Obq6HbplANGe0Zq148='
WHERE
key_id = '33c25c7d8c49fdd1712dfd62d930716f563cea7b77ff4515aaf736e7cb9d1c82'
AND (
token = 'cgEQP98kFKIefkrb+nRomF4r2Obq6HbplANGe0Zq148='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)