UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bxWUYUKnVzsUPMjYu87l7tsCq90k71UDSpAn4NI5S1o='
WHERE
key_id = '2e52d5eb8c4e6662bc062efa75c45d0e878153b57f5bca7da7fbdca664663b38'
AND (
token = 'bxWUYUKnVzsUPMjYu87l7tsCq90k71UDSpAn4NI5S1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)