UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uVhw5PPclAGDveY4YfBYrUYMcknSDCINpbXe5pleK9I='
WHERE
key_id = '6b489f8f689227f136e7d3947ed5a04464dd23e846723fd3656805189be3656e'
AND (
token = 'uVhw5PPclAGDveY4YfBYrUYMcknSDCINpbXe5pleK9I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)