UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0bcCJ5WO83YrrhufCFxraNci+64xc0i9oK806WXxcr4='
WHERE
key_id = 'd3db56f5f7cef0426c12e458ec30121febf64a4324de02fa8774e896d6ef3d75'
AND (
token = '0bcCJ5WO83YrrhufCFxraNci+64xc0i9oK806WXxcr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)