UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wHhxbSFuB7ld9TOsnOAVztJhpDmHXU9eh91Mxvc2ZBk='
WHERE
key_id = 'dc10c47d999703cf96528e12dcb0e5391c2c38830d51d737a29fe96284b5c7a2'
AND (
token = 'wHhxbSFuB7ld9TOsnOAVztJhpDmHXU9eh91Mxvc2ZBk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)