UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MJnExG/7lUhANHtNdVhhGDAbs7l9ID+qJOytAZ4zXFU='
WHERE
key_id = 'bbd07df8d524bf6b8148d1f5012ba82faf86c9e38fa9d499b2ad01d666095922'
AND (
token = 'MJnExG/7lUhANHtNdVhhGDAbs7l9ID+qJOytAZ4zXFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)