UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dcX5nyCKneUwHh8WYbd+jnR/U04ESuW6BxhVxangHp4='
WHERE
key_id = '7ecf3e25e4ed6a047f295c91b41533b1ac36bcdab25108e2ae5b20af9ee48de2'
AND (
token = 'dcX5nyCKneUwHh8WYbd+jnR/U04ESuW6BxhVxangHp4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)