UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aEfc9BHDGr53mbiLUAqDQ0R5D4c+bdpaS2MNtWzO3Jo='
WHERE
key_id = '37c46c2e4f6d42af33720fece82ed7d3e60345002ca42bf1d96125735a43d182'
AND (
token = 'aEfc9BHDGr53mbiLUAqDQ0R5D4c+bdpaS2MNtWzO3Jo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)