UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bcuILf2PQUB2/voDv5FX9K0RVcxmB7XMunpIiiQV9lA='
WHERE
key_id = '95663e8a0f0bee47b805bfeee7687f63e5a1fff74439ff6d18663e1e1cda9508'
AND (
token = 'bcuILf2PQUB2/voDv5FX9K0RVcxmB7XMunpIiiQV9lA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)