UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2dIZOwmz4dUYdAuiivbMxwzhHiMYbStM8B+PIOYb2tA='
WHERE
key_id = '2cd383815dabce1e416201698ea36110d3bf6f02d4876259d427e65111e535cd'
AND (
token = '2dIZOwmz4dUYdAuiivbMxwzhHiMYbStM8B+PIOYb2tA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)