UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rbQk03+FlUbMaOo4DqChYJJ38AVdrCg4atI8I4ovHGg='
WHERE
key_id = '6639e5fdbdcc10a255ad9bb65f18e0dc8cc496bb1d413df9bb8e89d3369f23de'
AND (
token = 'rbQk03+FlUbMaOo4DqChYJJ38AVdrCg4atI8I4ovHGg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)