UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0ml5C05y8MMBQhCFdS6i1UiY/o6Ko0COlUuUBtHaSq4='
WHERE
key_id = '0872195d136b3ff879c318d03b201b0d31791cd553b6f0eaf186427e6966a366'
AND (
token = '0ml5C05y8MMBQhCFdS6i1UiY/o6Ko0COlUuUBtHaSq4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)