UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BV+ZVD6pFPlyZXbzb1O2BlRWYrWsiXKWtnhnMvcYEjs='
WHERE
key_id = 'e45369064b202a8e813c8183ce928113fcd4e6255217b0c7d4b8137be7b52726'
AND (
token = 'BV+ZVD6pFPlyZXbzb1O2BlRWYrWsiXKWtnhnMvcYEjs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)