UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H6RLwTiebAWGv9PP12AFlGJRH6tv5FrfMNAdNBdWItE='
WHERE
key_id = '1e7aa7123fc00995c35f8881fc5be90977750b36741d07fe74b1d804e48f7de9'
AND (
token = 'H6RLwTiebAWGv9PP12AFlGJRH6tv5FrfMNAdNBdWItE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)