UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UNGMTfnkRe3nJFLwOSwsBfv8aVqMYQryjeXUr9r9pEk='
WHERE
key_id = '04de380cdd2b51b5f6fa0893db0a6bc1b0276c8f6b197f4a372d1888b5528f4b'
AND (
token = 'UNGMTfnkRe3nJFLwOSwsBfv8aVqMYQryjeXUr9r9pEk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)