UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AsgpZ0rAY9i8jbZP1SsH1RInSh4j/hSgY8xBoz6rF5I='
WHERE
key_id = '59972708f718e9540639199edb92e027e6a450c4cd79cfa95d8c23fe3fd47d4e'
AND (
token = 'AsgpZ0rAY9i8jbZP1SsH1RInSh4j/hSgY8xBoz6rF5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)