UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dU+3XUfMvQQBLxagJ6N2zcUBCwwQYjZuX+veAPEwLZ0='
WHERE
key_id = 'f07cc49882731bf1ebd1028bd863523c526dac739099c69f5d6d943eaa1763c9'
AND (
token = 'dU+3XUfMvQQBLxagJ6N2zcUBCwwQYjZuX+veAPEwLZ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)