UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ecYGK8L1DqNkCMsCgGdW1a/1JKL6YJR3D3CSqNQmtUs='
WHERE
key_id = '700b0fdfb76b7f58909301431c8e4459ed0007f779e8994bb70767e0aa372fe9'
AND (
token = 'ecYGK8L1DqNkCMsCgGdW1a/1JKL6YJR3D3CSqNQmtUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)