UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0zvYj/SqieDenhbmShsM4QTR5rIp1E4T0S1QPIVZyZg='
WHERE
key_id = 'ecf71e056fa3227ab2a64d065e9fc38ccd62d0c24d821caace89bd73d43ca9e8'
AND (
token = '0zvYj/SqieDenhbmShsM4QTR5rIp1E4T0S1QPIVZyZg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)