UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ll6GuDLuVNmF5KtODafyz8Wb7NT8Z31iaqs3VUSMznc='
WHERE
key_id = 'd967b30d796d259f161680602dcb2bd28666ae4514cc753bbfae9f94763704dd'
AND (
token = 'Ll6GuDLuVNmF5KtODafyz8Wb7NT8Z31iaqs3VUSMznc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)