UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/jcTPK9eO7qVb1eRu8rTXLbPaqqB0RmyMcx0/cuTj6o='
WHERE
key_id = '1548181a54ccd46af57e8103870e6d34f0737937506e5be65bc064ae4fd7dfce'
AND (
token = '/jcTPK9eO7qVb1eRu8rTXLbPaqqB0RmyMcx0/cuTj6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)