UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dbk1VRP9A7Xu3SvitblTnA5Kj+7Ero7U0igxks6FuqQ='
WHERE
key_id = '9594b7ee0ee76d73f8c2dc3214666c0a8f506ffc2ed90c94a1f6588eefc4af99'
AND (
token = 'dbk1VRP9A7Xu3SvitblTnA5Kj+7Ero7U0igxks6FuqQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)