UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L1f16TWUOO9EctrTGmWNHT4rvrdBMYWvITAtUP0k2ho='
WHERE
key_id = '85b36f872a1aea494c8535248bd18780e488a5643f5def52ed657cb7aea1682e'
AND (
token = 'L1f16TWUOO9EctrTGmWNHT4rvrdBMYWvITAtUP0k2ho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)