UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pQ/aI7KNuAICuj+SOFBc0a+dXV5a3C0dhM2+iDFjbAQ='
WHERE
key_id = 'a6aeb45cce2fe290e6d2fde2e42e205d9b4da78786c05ad245f4b177b20dc9ae'
AND (
token = 'pQ/aI7KNuAICuj+SOFBc0a+dXV5a3C0dhM2+iDFjbAQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)