UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ItNdl8s2fwqWp0I83xVfuCTLGc/dmW61umavrelrGIc='
WHERE
key_id = '59492b30f5c627760b118bef922812950260cf5f95698ffd802c2177cf416519'
AND (
token = 'ItNdl8s2fwqWp0I83xVfuCTLGc/dmW61umavrelrGIc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)