UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0GGZYQYjcDkuzY8w6SIkYeJNfOt37n3jk+Zaa4Haj2Q='
WHERE
key_id = '4a3321874ace607411c29ebeae924ee6c71388713dbefe657eb9fa48fdc3e756'
AND (
token = '0GGZYQYjcDkuzY8w6SIkYeJNfOt37n3jk+Zaa4Haj2Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)